<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html>
<html>
<head>
    <%@ include file="/resource/common_html_meat.jsp" %>
    <%@ include file="/manage/system/common.jsp" %>
    <%@ include file="/resource/common_html_validator.jsp" %>
    <style>
        #insertOrUpdateMsg {
            border: 0px solid #aaa;
            margin: 0px;
            position: fixed;
            top: 0;
            width: 100%;
            background-color: #d1d1d1;
            display: none;
            height: 30px;
            z-index: 9999;
            font-size: 18px;
            color: red;
        }

        .btnCCC {
            background-image: url("../img/glyphicons-halflings-white.png");
            background-position: -288px 0;
        }
    </style>
</head>

<body>
<div class="navbar navbar-inverse">
    <div id="insertOrUpdateMsg">
        <s:property value="#session.insertOrUpdateMsg"/>
        <%request.getSession().setAttribute("insertOrUpdateMsg", "");//列表页面进行编辑文章的时候,需要清空信息 %>
    </div>
</div>

<s:form action="store" namespace="/manage" theme="simple" name="form" id="form">
    <input type="hidden" value="<s:property value="e.id"/>" id="id"/>
    <table class="table table-bordered">
        <tr>
            <td colspan="2" style="text-align: center;">
                <s:if test="e.id=='' or e.id==null">
                    <button method="store!insert.action" class="btn btn-success">
                        <i class="icon-ok icon-white"></i> 新增
                    </button>
                </s:if>
                <s:else>
                    <button method="store!update.action" class="btn btn-success">
                        <i class="icon-ok icon-white"></i> 保存
                    </button>
                </s:else>
            </td>
        </tr>
        <tr style="background-color: #dff0d8">
            <td colspan="2" style="background-color: #dff0d8;text-align: center;">
                <strong>门店信息 </strong>
            </td>
        </tr>
        <tr style="display: none;">
            <td>id</td>
            <td><s:hidden name="e.id" label="id"/></td>
        </tr>
        <tr>
            <td style="text-align: right;width: 100px;">门店名称</td>
            <td style="text-align: left;"><s:textfield name="e.name" id="name" style="width: 80%;"
                                                       data-rule="门店名称:required;remote[store!uniqueName.action?e.id=${e.id}]"/></td>
        </tr>
        <tr>
            <td style="text-align: right;width: 100px;">门店电话</td>
            <td style="text-align: left;"><s:textfield name="e.telPhone" id="telPhone" style="width: 80%;"
                                                       data-rule="门店电话:required;digits;remote[store!uniquePhone.action?e.id=${e.id}]"/></td>
        </tr>
        <tr>
            <td style="text-align: right;width: 100px;">门店地址</td>
            <td style="text-align: left;"><s:textfield name="e.address" id="address" style="width: 80%;"
                                                       data-rule="门店地址:required;"/></td>
        </tr>
        <tr>
            <td style="text-align: right;width: 100px;">门店经度</td>
            <td style="text-align: left;"><s:textfield name="e.telPhone" id="longitude" style="width: 80%;"/></td>
        </tr>
        <tr>
            <td style="text-align: right;width: 100px;">门店纬度</td>
            <td style="text-align: left;"><s:textfield name="e.telPhone" id="latitude" style="width: 80%;"/></td>
        </tr>
    </table>
</s:form>

<span id="pifeSpan" class="input-group-addon"
      style="display:none"><%=SystemManager.systemSetting.getImageRootPath()%></span>

<link rel="stylesheet" href="<%=request.getContextPath() %>/resource/kindeditor-4.1.7/themes/default/default.css"/>
<script charset="utf-8" src="<%=request.getContextPath() %>/resource/kindeditor-4.1.7/kindeditor-min.js"></script>
<script charset="utf-8" src="<%=request.getContextPath() %>/resource/kindeditor-4.1.7/lang/zh_CN.js"></script>

<script type="text/javascript">

    $(function () {
        var ccc = $("#insertOrUpdateMsg").html();
        console.log("insertOrUpdateMsg=" + insertOrUpdateMsg);
        if (ccc != '' && ccc.trim().length > 0) {
            $("#insertOrUpdateMsg").slideDown(1000).delay(1500).slideUp(1000);
        }
        ;
    });

    function selectDefaultCatalog() {
        var _catalogID = $("#catalogID").val() + "";//alert(_catalogID);
        if (_catalogID != '' && _catalogID > 0) {//alert("_catalogID="+_catalogID);
            $("#catalogSelect").val(_catalogID);
        }
    }
</script>


</body>
</html>
